<template>
	<view class="btn-wp" @click="handleClick">
		<view class="btn" hover-class="hoverClass">
			<slot>
			</slot>
			<view class="btn-title">
				{{title}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "bottom-button",
		data() {
			return {

			};
		},
		props: {
			title: {
				type: String,
				default: '点击按钮',
				required: true
			}
		},
		methods: {

			handleClick() {
				this.$emit('handleClick')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.btn-wp {
		background-color: #fff;
		width: 100%;
		height: calc(100rpx + constant(safe-area-inset-bottom));
		height: calc(100rpx + env(safe-area-inset-bottom));
		position: fixed;
		bottom: 0;
		left: 0;

		.btn {
			margin: 0 auto;
			width: 85%;
			background-color: $u-primary;
			height: 80rpx;
			display: flex;
			justify-content: center;
			align-items: center;

			.btn-title {
				margin-left: 10rpx;
				font-size: 30rpx;
				color: #FFFFFF;
				text-align: center;
				line-height: 80rpx;
			}

		}

		.hoverClass {
			box-shadow: 0 0 4rpx #eee;
		}
	}
</style>